home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
PROGRAM
/
XNAS213.ARJ
/
XNAS.DOC
< prev
next >
Wrap
Text File
|
1992-01-19
|
7KB
|
192 lines
X N A S Version 2.13
Introduction
------------
The development of XNAS was inspired by working on the development of
several C-language based tools. The history is somewhat lengthy, but
basically the desire to see the logic of a module at a glance was the
driving force of the development of XNAS.
As opposed to common C source beautifiers, XNAS does NOT generate compiler
processable C code from the original source code. Instead, it produces a
structogramme from your C source module, which allows you to easily inspect
the logic of the module. This is done by drawing the structure of the
module in such a way that "blocks" which are on the same level of hirarchy
appear horizontally adjacent in the output file (e.g. the ELSE branch of an
IF statement will always be on the right side of and the same hight as the
THEN branch).
This technique has the disadvantage that the output of a heavily nested
source module can become very wide, which will force you to tape together
several pages of the output listing. However, command line parameters allow
you to adjust the width of blocks in order to trim the output to your
needs.
Example:
The source code
while (!done) {
makeoutname(fcount);
if ((FILE *)NULL == (fo = fopen(outname, "w"))) {
printf("%s: cannot open\n", outname);
exit(2);
}
if (0 != setvbuf(fo, outbuf, _IOFBF, sizeof(outbuf))) {
printf("cannot set output buffer\n");
exit(4);
}
lcount = 0;
while (lcount++ < linecount) {
if ((char *)NULL == fgets(linebuff, LINE_SIZE, fi)) {
done++;
break;
}
if (EOF == fputs(linebuff, fo)) {
printf("%s: write error\n", outname);
exit(3);
}
}
fclose(fo);
fcount++;
}
will produce the following output file:
+-------------------------------------------------------------------------+
| while (!done) |
| +----------------------------------------------------------------------+
| | makeoutname(fcount); |
| +----------------------------------------------------------------------+
| | if ((FILE *)NULL == (fo = fopen(outname, "w"))) |
| +-T--------------------------------------------+-F---------------------+
| | printf("%s: cannot open\n", outname); | |
| | exit(2); | |
| +----------------------------------------------+-----------------------+
| | if (0 != setvbuf(fo, outbuf, _IOFBF, sizeof(outbuf))) |
| +-T--------------------------------------------+-F---------------------+
| | printf("cannot set output buffer\n"); | |
| | exit(4); | |
| +----------------------------------------------+-----------------------+
| | lcount = 0; |
| +----------------------------------------------------------------------+
| | while (lcount++ < linecount) |
| | +-------------------------------------------------------------------+
| | | if ((char *)NULL == fgets(linebuff, LINE_SIZE, fi)) |
| | +-T------------------------------------------+-F--------------------+
| | | done++; | |
| | | break; | |
| | +--------------------------------------------+----------------------+
| | | if (EOF == fputs(linebuff, fo)) |
| | +-T------------------------------------------+-F--------------------+
| | | printf("%s: write error\n", outname); | |
| | | exit(3); | |
| +--+--------------------------------------------+----------------------+
| | fclose(fo); |
| | fcount++; |
+--+----------------------------------------------------------------------+
Command Syntax
--------------
XNAS sourcefile [options]
sourcefile = filename of your C source file (if not in current directory,
do not forget to include the proper path name)
Options are:
-b<blocksize> = minimum width (in columns) of a block in the output
file, default is 8. Range: 6<blocksize<100.
-e<emptysize> = width (in columns) of an empty block, default is
Range: 2<emptysize<100.
-er<emptysize>= minimum width of an empty block, default is 4.
Range: 2<emptysize<100.
-k = do not strip spaces (global)
-kc = do not strip spaces in comments
-ks = do not strip spaces in strings
-p<linesize> = page width (in columns), default is 162. Should be set
to 80 for screen output.
Range: 10<linesize<1000.
-v = quiet mode; switches off start and end message.
-x = switches off the generation of printer control
characters. Printer control characters are generated
for EPSON compatible printers.
The output will always be written to file. The file name is same as the
source file name except that the .C extension is replaced by .NAS .
HISTORY
-------
Version 2.13 First public release (no joke, there actually where
many versions before this one).
LICENSING POLICY
----------------
XNAS and its associated documentation are copyright (c) 1991 Walter Sorger,
all rights reserved. The XNAS software may not be circulated in any
incomplete or modified form, nor sold for profit, without written
permission of the author.
You may use this version (2.13) of XNAS without paying a licensing fee,
however, the author reserves the right to provide further versions of XNAS
on the normal shareware basis, i.e. charging a license fee.
If you like this little tool or if you have any comments or suggestions for
improvements, please write to the author:
Walter Sorger
Seebenseestr. 28
8000 Muenchen 70
Germany
DISTRIBUTION POLICY
-------------------
XNAS may be distributed freely. If you distribute this software to others,
you are required to distribute the ENTIRE package consisting of the
following files:
XNAS.EXE
XNAS.DOC
README.1ST
DISCLAIMER
----------
This software is provided on an "as is" basis without warranty of any
kind, expressed or implied, including but not limited to the implied
warranties of merchantability and fitness for a particular purpose. The
person using the software bears all risk as to the quality and performance
of the software. The author will not be liable for any special,
incidental, consequential, indirect or similar damages due to loss of data
or any other reason, even if the author or an agent of the author has been
advised of the possibility of such damages. In no event shall the author's
liability for any damages ever exceed the price paid for the license to use
the software, regardless of the form of the claim.